﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
public class Sibling : MonoBehaviour
{
    private void Update()
    {
        this.gameObject.GetComponent<Animator>().speed = UltimateSkillManager.aniSpeed;
    }
    void OnTriggerEnter2D(Collider2D collidedObject)
    {
        if (collidedObject.gameObject.name == "upGameObject")
        {
            transform.SetAsFirstSibling();
        }
        if (collidedObject.gameObject.name == "downGameObject")
        {
            transform.SetAsLastSibling();//层级的改变，将变换移动到本地变换列表的末尾。
        }
    }

}
